A generator function is defined with function* and returns a Generator object. It can be paused and resumed, yielding multiple values over time, unlike regular functions which run to completion.
Generator functions are defined with function* syntax. When called, they return a Generator object (an iterator) but do not execute immediately. The function body executes incrementally each time next() is called, pausing at each yield expression. This allows functions to produce a sequence of values lazily and maintain state between executions, which is impossible with regular functions.